package com.centronix.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.centronix.domain.ProductType;
@Repository
public interface ProductTypeDAO extends JpaSpecificationExecutor<ProductType>, JpaRepository<ProductType, Integer>{
	@Query("select pt from ProductType pt where lower(pt.narrative) like :ptName ")
	public List<ProductType> findByProductTypeName(@Param("ptName") String paramName);
	
	@Query("select pt from ProductType pt where pt.productCatagory.catagoryId =:catId  ")
	public List<ProductType> findByProductCategoryId(@Param("catId") int catId);
	
}
